package com.zorn.platform.component.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class UserAndRoleComponentQuerier implements IComponentQuerier {

	private IComponentQuerier roleComponentQuerier;
	private IComponentQuerier userComponentQuerier;

	@Override
	public List<Map<String, Object>> getComponents(Map<String, Object> params) {
		List<Map<String, Object>> components = new ArrayList<Map<String, Object>>(roleComponentQuerier.getComponents(params));
		components.addAll(userComponentQuerier.getComponents(params));
		return components;
	}

	public void setRoleComponentQuerier(IComponentQuerier roleComponentQuerier) {
		this.roleComponentQuerier = roleComponentQuerier;
	}

	public void setUserComponentQuerier(IComponentQuerier userComponentQuerier) {
		this.userComponentQuerier = userComponentQuerier;
	}

}
